{% extends "main/base.html" %}
{% load static i18n %}
{% block title %}{% trans '更新组装采购' %}{% endblock %}
{% block this_css %}
<link rel="stylesheet" type="text/css" href="{% static 'flatlab/css/bootstrap-select.min.css' %}">
{% endblock %}
{% block content %}
<section class="col-lg-offset-3 col-lg-7">
    <section class="panel">
        <header class="panel-heading">
            {% trans "更新组装采购" %}
            {% if form.errors %}
            <p>{% trans "您提交的数据有误,请认真检查!" %}</p>
            {% endif %}
            {{ form.errors }}
            {{ form.non_field_errors }}
        </header>
        <div class="panel-body">
            <form method="post" class="form-horizontal">{% csrf_token %}
                <div class="form-group">
                    <div class="col-lg-2">{{ form.related_equipment_assembly.label_tag }}</div>
                    <div class="col-lg-10">{{ form.related_equipment_assembly }}{{ form.related_equipment_assembly.errors }}</div>
                </div>
                <div class="form-group">
                    <div class="col-lg-2">{{ form.amount.label_tag }}</div>
                    <div class="col-lg-4">{{ form.amount }}{{ form.amount.errors }}</div>
                    <div class="col-lg-2">{{ form.is_ordered.label_tag }}</div>
                    <div class="col-lg-4">
                        <div class="switch switch-square"
                            data-on-label="<i class=' fa fa-check'></i>"
                            data-off-label="<i class='fa fa-times'></i>">
                            {{ form.is_ordered }}
                        </div>{{ form.is_ordered.errors }}
                    </div>
                </div>
                <div class="form-group">
                    <div class="col-lg-2">{{ form.notes.label_tag }}</div>
                    <div class="col-lg-10">{{ form.notes }}{{ form.notes.errors }}</div>
                </div>
                <div class="form-group" align="right">
                    <div class="col-lg-12">
                        {% if perms.main.delete_planassembly %}
                        <a href="{% url 'main:plan_assembly_delete' object.pk %}"><button type="button" class="btn btn btn-danger">{% trans "删除" %}</button></a>{% endif %}
                        <button type="submit" class="btn btn-primary">{% trans "提交" %}</button>
                    </div>
                </div>
            </form>
        </div>
    </section>
</section>
{% endblock %}
{% block this_js %}
<script type="text/javascript" src="{% static 'flatlab/js/bootstrap-switch.js' %}"></script>
<script type="text/javascript" src="{% static 'flatlab/js/bootstrap-select.min.js' %}"></script>
{% endblock %}